home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #183 (199x)(Rhein-Sieg-Soft).zip / Franz PD Disk #183 (199x)(Rhein-Sieg-Soft).adf / Fenster / Objectfiles / ImageDemo.ass < prev    next >
Text File  |  1992-07-19  |  3KB  |  124 lines

  1.     opt    l+,o+
  2.  
  3. ; ----------------------------------------------------------
  4. ; --                Assembler Image Demo                  --
  5. ; ----------------------------------------------------------
  6. ; -- Author    : Roger Fischlin                           --
  7. ; -- Copyright : Public Domain                            --
  8. ; -- Assembler : DevPac Assembler V2.11                   --
  9. ; ----------------------------------------------------------
  10. ; -- create linkable code and link objectfile & "Fish.o". --
  11. ; ----------------------------------------------------------
  12.  
  13.     INCDIR    "dh1:include/"
  14.  
  15.     INCLUDE    "exec/exec_lib.i"
  16.     INCLUDE    "intuition/intuition_lib.i"
  17.     INCLUDE    "intuition/intuition.i"
  18.  
  19.  
  20. WIDTH    equ    132    ; taken from 'SAVE' requester
  21. HEIGHT    equ    57
  22.  
  23.     XREF    _ImageData
  24.  
  25.     Section    "",CODE
  26.  
  27. ; ---------------- include startup code  ----------------
  28.  
  29.     INCLUDE    "misc/easystart.i"
  30.  
  31. ; ------------ open "intuition.library" V33 -------------
  32.  
  33.     lea.l    IntName,a1
  34.     moveq.l    #33,d0
  35.     move.l    4.w,a6
  36.     jsr    _LVOOpenLibrary(a6)
  37.     move.l    d0,a5
  38.     tst.l    d0
  39.     bne.s    OpenWd
  40.     moveq.l    #20,d0    ; fatal error !
  41.     rts
  42.  
  43. ; -------------------- open window ---------------------
  44.  
  45. OpenWd    lea.l    NWindow,a0
  46.     exg    a6,a5    ; use IntuitionBase
  47.     jsr    _LVOOpenWindow(a6)
  48.     exg    a6,a5
  49.     move.l    d0,a4
  50.     tst.l    d0    ; error ?
  51.     beq.s    CloseInt
  52.  
  53. ; ------------------ draw image -----------------------
  54.  
  55. DrawImage    move.l    wd_RPort(a4),a0
  56.     lea.l    Bild,a1
  57.     moveq.l    #0,d0
  58.     moveq.l    #0,d1
  59.     move.b    wd_BorderLeft(a4),d0
  60.     move.b    wd_BorderTop(a4),d1
  61.     addq.w    #8,d0
  62.     addq.w    #4,d1
  63.     exg    a6,a5    ; use IntuitionBase
  64.     jsr    _LVODrawImage(a6)
  65.     exg    a6,a5
  66.  
  67. ; ---------------------- wait -------------------------
  68.  
  69. Wait    move.l    wd_UserPort(a4),a2
  70.     move.l    a2,a0
  71.     jsr    _LVOWaitPort(a6)
  72.     move.l    a2,a0
  73.     jsr    _LVOGetMsg(a6)
  74.     tst.l    d0
  75.     beq.s    Wait
  76.     move.l    d0,a1
  77.     move.l    im_Class(a1),d2; get Class
  78.     jsr    _LVOReplyMsg(a6)
  79.     cmp.l    #CLOSEWINDOW,d2
  80.     beq.s    CloseWd    ; CLOSEWINDOW -> close window
  81.     cmp.l    #NEWSIZE,d2
  82.     beq.s    DrawImage    ; NEWSIZE -> draw image again
  83.     bra.s    Wait
  84.     
  85.  
  86. ; ------------------- close window ---------------------
  87.  
  88. CloseWd    move.l    a4,a0
  89.     exg    a6,a5    ; use IntuitionBase
  90.     jsr    _LVOCloseWindow(a6)
  91.     exg    a6,a5
  92.     
  93. ; ------------ close "intuition.library" ---------------
  94.  
  95. CloseInt    move.l    a5,a1
  96.     jsr    _LVOCloseLibrary(a6)
  97.     moveq.l    #0,d0
  98.     rts
  99.  
  100. ; ------------------ data section ----------------------
  101.  
  102.     Section    "",DATA
  103.  
  104. IntName    DC.B    "intuition.library",0
  105.     EVEN
  106.  
  107. NWindow    DC.W    20,20,WIDTH+40,HEIGHT+20
  108.     DC.B    -1,-1
  109.     DC.L    CLOSEWINDOW!NEWSIZE
  110.     DC.L    WINDOWSIZING!WINDOWDRAG!WINDOWDEPTH!WINDOWCLOSE!SMART_REFRESH!ACTIVATE
  111.     DC.L    0,0,Title
  112.     DC.L    0,0
  113.     DC.W    WIDTH+40,HEIGHT+20,-1,-1
  114.     DC.W    WBENCHSCREEN
  115.  
  116. Title    DC.B    "Assembler-Image-Demo",0
  117.     EVEN
  118.     
  119. Bild    DC.W    0,0,WIDTH,HEIGHT,2
  120.     DC.L    _ImageData
  121.     DC.B    1+2,0
  122.     DC.L    0
  123.  
  124.